<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title><?=$title ?></title>
    <meta name="description" content="<?=str_replace('"', '', $description); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?=Helper_Index::canonical_url(); ?>
    
    <link href="/media/css/bootstrap.css" rel="stylesheet">
    <link href="/media/css/font-awesome.min.css" rel="stylesheet">
    <link href="/media/css/style.css" rel="stylesheet">
    <link href="/media/css/smoothproducts.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,300,600&subset=cyrillic-ext,latin' rel='stylesheet' type='text/css'>
    <link href="/media/css/social-likes_classic.css" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico">
    
    <script src="/media/js/jquery.js"></script>
    <script src="/media/js/bootstrap.js"></script>
    <script src="/media/js/jquery.blImageCenter.js"></script>
    <script src="/media/js/mimity.js"></script>
    <script src="/media/js/jquery.unveil.js"></script>
    <script src="/media/js/general.js"></script> 
    <script src="/media/js/smoothproducts.min.js"></script>
    <script src="/media/js/social-likes.min.js"></script>
    <script src="/media/js/easyTooltip.js"></script>
    
    
    <?php
    $user = Model_Auth::instance()->get_user();
    if ($user): ?>
    <script type="text/javascript">
        LoginRegisterManager.setLogin(true);
    </script>
    <?php endif; ?>
    
    <script type="text/javascript">
        var yaParams = {};
    </script>
    
</head>

<body itemscope itemtype="http://schema.org/WebPage">
    <header>
        <div class="container">
            <div class="row">

                <!-- Logo -->
                <div class="col-lg-4 col-md-3 hidden-sm hidden-xs">
                    <div class="well logo">
                        <span class="hlink" data-hlink="<?=base64_encode('/') ?>">
                            Style<span>Garderob</span>
                        </span>
                        <div>Вы точно найдете вещь для души =)</div>
                    </div>
                </div>
                <!-- End Logo -->

                <!-- Login & Search Form -->
                <div class="col-lg-8 col-md-9 col-sm-12 col-xs-12">
                    <div class="login-register-block pull-right">
                        <?php if ($user): ?>
                        Привет, <?=$user->email ?>! <a href="/my">Мой аккаунт</a> | <a href="/logout">Выход</a>
                        <?php else: ?>
                        <span class="hlink" data-hlink="<?=base64_encode('/info/contacts') ?>">Контакты</span> | <span class="hlink" data-hlink="<?=base64_encode('/login') ?>">Вход</span> | <span class="hlink" data-hlink="<?=base64_encode('/register') ?>">Регистрация</span>
                        <?php endif; ?>
                    </div>
                
                    <div class="well search">
                        <form method="post" onsubmit="var query = $(this).find('input[type = text]').val(); var url = '/search/' + query; document.location = encodeURI(url); return false;">
                            <div class="input-group">
                                <input type="text" class="form-control input-search" <?php if ($search_query): ?>value="<?=$search_query ?>"<?php else: ?>placeholder="Введите что-нибудь..."<?php endif; ?> />
                                <span class="input-group-btn">
                                    <button class="btn btn-default no-border-left" type="submit"><i class="fa fa-search"></i></button>
                                </span>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- End Search Form -->
            </div>
        </div>
    </header>
    
    <div id="fake-top-navigation"></div>
    
    <?=$content ?>

    <?php /*
    <footer>
        <div class="container">
            <div class="col-lg-3 col-md-3 col-sm-6">
                <div class="column">
                    <h4>Information</h4>
                    <ul>
                        <li><a href="about.html">About Us</a></li>
                        <li><a href="typography.html">Policy Privacy</a></li>
                        <li><a href="typography.html">Terms and Conditions</a></li>
                        <li><a href="typography.html">Shipping Methods</a></li>
                    </ul>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6">
                <div class="column">
                    <h4>Categories</h4>
                    <ul>
                        <li><a href="catalogue.html">Cras justo odio</a></li>
                        <li><a href="catalogue.html">Dapibus ac facilisis in</a></li>
                        <li><a href="catalogue.html">Morbi leo risus</a></li>
                        <li><a href="catalogue.html">Porta ac consectetur ac</a></li>
                    </ul>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6">
                <div class="column">
                    <h4>Customer Service</h4>
                    <ul>
                        <li><a href="contact.html">Contact Us</a></li>
                        <li><a href="#">YM: erwin_heldy</a></li>
                        <li><a href="#">Telp: 087825376xxx</a></li>
                        <li><a href="#">Email: erwin.heldy@gmail.com</a></li>
                    </ul>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6">
                <div class="column">
                    <h4>Follow Us</h4>
                    <ul class="social">
                        <li><a href="#">Google Plus</a></li>
                        <li><a href="#">Facebook</a></li>
                        <li><a href="#">Twitter</a></li>
                        <li><a href="#">RSS Feed</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="navbar-inverse text-center copyright">
            Copyright &copy; 2013 Mimity All right reserved
        </div>
    </footer>    */ ?>
    
    <?=Helper_Index::top_menu(); ?> 

    <a href="#top" class="back-top text-center" onclick="$('body,html').animate({scrollTop:0},500); return false">
        <i class="fa fa-angle-double-up"></i>
    </a>

    <?php if (isset($_GET['profiler'])): ?>
    <div style="display: none;"><?php echo View::factory('profiler/stats'); ?> </div>
    <?php endif; ?>
    
    <noindex>
    <div class="modal fade" id="login-register-modal" tabindex="-1" role="dialog" aria-labelledby="login-register-modal-label" aria-hidden="true"> 
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                     <h5 class="modal-title" id="login-register-modal-label">Вход</h6>
                </div>
                <div class="modal-body">
                    <ul class="nav nav-tabs" id="myTab">
                        <li class="active"><a data-toggle="tab" href="#register">Регистрация</a></li>
                        <li class=""><a data-toggle="tab" href="#login">Вход</a></li>
                    </ul>
                    <div class="tab-content" id="myTabContent">
                        <div id="register" class="tab-pane fade active in">
                            <p>Для продолжения необходима регистрация. Если у вас есть аккаунт, то войдите<br />+ 50 рублей на счет в подарок!</p>
                            <div class="form">
                                <form action="/register" method="post" target="_blank" class="form-horizontal">
                                    <div class="form-group">
                                        <label for="email" class="control-label col-md-3">Email</label>
                                        <div class="col-md-9">
                                            <input type="text" id="email" name="email" class="form-control" placeholder="mail@mail.ru">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="email" class="control-label col-md-3">Пароль</label>
                                        <div class="col-md-9">
                                            <input type="password" id="password" name="password" class="form-control">
                                        </div>
                                    </div>

                                    <input type="hidden" name="redirect_url" value="" />
                                    <div class="form-group">
                                        <div class="col-md-9 col-md-offset-3"> 
                                            <button class="btn btn-primary" type="submit">Регистрация</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>

                        <div id="login" class="tab-pane fade">
                            <div class="form">
                                <form action="/login" method="post" target="_blank" class="form-horizontal"> 
                                    <div class="form-group">
                                        <label for="email" class="control-label col-md-3">Email</label>
                                        <div class="col-md-9">
                                            <input type="text" id="email" name="email" class="form-control">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="email" class="control-label col-md-3">Пароль</label>
                                        <div class="col-md-9">
                                            <input type="password" id="password" name="password" class="form-control">
                                        </div>
                                    </div>

                                    <input type="hidden" name="redirect_url" value="" />
                                    <div class="form-group">
                                        <div class="col-md-9 col-md-offset-3"> 
                                            <button class="btn btn-primary" type="submit">Войти</button>
                                        </div>
                                    </div>
                                </form>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </noindex>
    
    <?php if (!$user): ?>
    <noindex>
    <nav class="navbar navbar-default navbar-fixed-bottom hidden-xs hidden-sm" id="bottom-navbar" role="navigation">
        <a class="pull-left navbar-text carousel-control" style="width: auto; left: 0px;" href="#" onclick="toggleBottomNavbar(); return false;" role="button">
            <span class="glyphicon glyphicon-chevron-right" style="left: 0; right: 0;"></span>
        </a>
    
        <div class="container">
            <p class="navbar-text"><strong>Зарегистрируйтесь</strong> и получите скидку практически на все товары!</p>            
            <form action="/register" method="post" target="_blank" class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" id="email" name="email" class="form-control" placeholder="Email, mail@mail.ru">
                </div>

                <div class="form-group">
                    <input type="password" id="password" name="password" class="form-control" placeholder="Пароль">
                </div>

                <input type="hidden" name="redirect_url" value="<?=$_SERVER['REQUEST_URI'] ?>" />
                <input type="hidden" name="utm_marks" value="utm_source=self;utm_medium=bottom-navbar;utm_content=1" />
                
                <button class="btn btn-default" type="submit">Регистрация</button>
            </form>
        </div>
    </nav>
    <script type="text/javascript">
        if ($('#bottom-navbar').css('display') == 'block') {
            $('body').css('padding-bottom', '50px');
        }
    
        var isVisibleBottomNavbar = true;
        function toggleBottomNavbar() {
            if (isVisibleBottomNavbar) {
                $('#bottom-navbar').css('width', '35px').css('overflow', 'hidden').css('left', 'auto'); 
                $('#bottom-navbar .container').hide();
                $('#bottom-navbar > a > span').removeClass('glyphicon-chevron-right').addClass('glyphicon-chevron-left');
                $('body').css('padding-bottom', '0px');
                isVisibleBottomNavbar = false;   
            } else {
                $('#bottom-navbar').css('width', '100%').css('overflow', 'none'); 
                $('#bottom-navbar .container').show();
                $('#bottom-navbar > a > span').removeClass('glyphicon-chevron-left').addClass('glyphicon-chevron-right');
                $('body').css('padding-bottom', '50px');
                isVisibleBottomNavbar = true;   
            } 
        }
        
        yaParams['register-cashback-type'] = 'register-cashback-bottom-navbar';
        $('#bottom-navbar form').submit(function () {
            yaCounter25485032.reachGoal('register-cashback-bottom-navbar');       
        });
    </script>
    </noindex>
    <?php endif; ?>
    
    <?php /*  
    $show = true;
    if ($user) {
        $show = false;   
    } else {
        $session = Session::instance();
        if ($show_count = $session->get('viewed-cashback-modal')) {
            if ($show_count && $show_count >= 1) {
                $show = false;   
            }
        }
    }
    if ($show): ?>
    <?php if (Model_Main::split_test(array(50, 50)) == 'a'): 
    $title = 'Получайте деньги за онлайн-покупки';
    $image = '/media/images/landing/cashback/2.jpg'; ?>
    <script type="text/javascript">
        var register_cashback_type = 'register-cashback-bonus';
    </script>
    <?php else:
    $title = 'Экономьте на онлайн-покупках';
    $image = '/media/images/landing/cashback/3.jpg'; ?>
    <script type="text/javascript">
        var register_cashback_type = 'register-cashback-discount';
    </script>
    <?php endif; ?>
    <noindex>
    <div class="modal fade" id="cashback-landing-modal" tabindex="-1" role="dialog" aria-labelledby="login-register-modal-label" aria-hidden="true"> 
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                     <h5 class="modal-title" id="cashback-landing-modal-label">Добро пожаловать на StyleGarderob.com</h6>
                </div>
                <div class="modal-body">
                    <div class="col-lg-8 col-md-8 col-sm-12">
                        <h2><?=$title ?></h2>
                        <h4>Представьте, вы покупаете брюки на Lamoda.ru за <strong>1990 р</strong>., и на вашу банковскую карту начисляются <strong>180 р</strong>.</h4>
                        <br /><p><center><img src="<?=$image ?>" style="height: 270px; max-width: 100%;" /></center></p>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-12">
                        <form action="/register" method="post" target="_blank" role="form" id="payment_form" class="jumbotron">
                            <h3 style="margin-bottom: 5px;">Для этого нужна регистрация</h3>
                            <span style="margin-bottom: 20px; display: block;">Не откладывайте, зарегистрируйтесь прямо сейчас!</span> 
                            <div class="form-group">
                                <input type="text" class="form-control" name="email" placeholder="Email">
                            </div>
                            <div class="form-group">
                                <input type="password" class="form-control" name="password" placeholder="Пароль">
                            </div>
                            <input type="hidden" name="redirect_url" value="/shop/all" />
                            <button type="submit" class="btn btn-primary">Регистрация</button>
                        </form>
                    </div> 
                    <div class="clearfix"></div>       
                </div>
                <div class="modal-footer">
                    <a href="#" data-dismiss="modal" aria-hidden="true">Закрыть окно</a>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        yaParams['register-cashback-type'] = register_cashback_type;
        setTimeout("$('#cashback-landing-modal').modal()", 10000);
        $('#cashback-landing-modal form').submit(function () {
            yaCounter25485032.reachGoal(register_cashback_type);
            $('#cashback-landing-modal').modal('hide');
            setTimeout('document.location = document.location', 2000);       
        });
    </script>
    </noindex>
    <?php
    if ($show) {
        if ($show_count) {
            $show_count++;    
        } else {
            $show_count = 1;
        }
        $session->set('viewed-cashback-modal', $show_count);
    }
    endif;*/ ?>
    
    <!-- Yandex.Metrika counter -->
    <script type="text/javascript">
    (function (d, w, c) {
        (w[c] = w[c] || []).push(function() {
            try {
                w.yaCounter25485032 = new Ya.Metrika({id:25485032,
                        webvisor:true,
                        clickmap:true,
                        trackLinks:true,
                        accurateTrackBounce:true,
                        params:yaParams});
            } catch(e) { }
        });

        var n = d.getElementsByTagName("script")[0],
            s = d.createElement("script"),
            f = function () { n.parentNode.insertBefore(s, n); };
        s.type = "text/javascript";
        s.async = true;
        s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";

        if (w.opera == "[object Opera]") {
            d.addEventListener("DOMContentLoaded", f, false);
        } else { f(); }
    })(document, window, "yandex_metrika_callbacks");
    </script>
    <noscript><div><img src="//mc.yandex.ru/watch/25485032" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
    <!-- /Yandex.Metrika counter -->
    
    <script>
     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
     })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

     ga('create', 'UA-52559253-1', 'auto');
     ga('send', 'pageview');

    </script>

</body>
</html>
